package org.viettan.android.main.activities.articles;

import java.util.List;

import org.viettan.android.main.activities.common.ArticleListActivity;
import org.viettan.android.main.intents.IntentKeys;
import org.viettan.android.main.io.EntityRetrievalException;
import org.viettan.android.main.managers.ArticleManager;
import org.viettan.android.main.model.Article;

import com.google.inject.Inject;

/**
 * Displays the latest Viet Tan news in a list and allows the user to select an article.
 */
public class SectionActivity extends ArticleListActivity {

    @Inject
    private ArticleManager articleManager;

    @Override
    protected List<Article> getArticles(boolean useCache) throws EntityRetrievalException {
	int sectionId = getIntent().getIntExtra(IntentKeys.SECTION_ID.name(), 0);
	return articleManager.getArticlesInSection(sectionId, useCache);
    }
}
